/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.app.model.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Santiago
 */
@Entity
@Table(name = "jmb_user_posts")
@XmlRootElement
@NamedQueries({
  @NamedQuery(name = "JmbUserPosts.findAll", query = "SELECT j FROM JmbUserPosts j ORDER BY j.postId DESC"),
  @NamedQuery(name = "JmbUserPosts.findByPostId", query = "SELECT j FROM JmbUserPosts j WHERE j.postId = :postId"),
  @NamedQuery(name = "JmbUserPosts.findByPostTitle", query = "SELECT j FROM JmbUserPosts j WHERE j.postTitle = :postTitle"),
  @NamedQuery(name = "JmbUserPosts.findByPostBeans", query = "SELECT j FROM JmbUserPosts j WHERE j.postBeans = :postBeans"),
  @NamedQuery(name = "JmbUserPosts.findByPostDescription", query = "SELECT j FROM JmbUserPosts j WHERE j.postDescription = :postDescription"),
  @NamedQuery(name = "JmbUserPosts.findByPostUserId", query = "SELECT j FROM JmbUserPosts j WHERE j.postUserId = :postUserId"),
  @NamedQuery(name = "JmbUserPosts.findByPostUserJnick", query = "SELECT j FROM JmbUserPosts j WHERE j.postUserJnick = :postUserJnick")})

public class JmbUserPosts implements Serializable {

  private static final long serialVersionUID = 1L;
  @Id
  @SequenceGenerator(name = "post_id_generator", sequenceName = "jmb_user_posts_post_id_seq", allocationSize = 1)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "post_id_generator")
  @Basic(optional = false)
  @NotNull
  @Column(name = "post_id",unique=true, nullable=false)
  private Integer postId;
  @Size(max = 100)
  @Column(name = "post_title")
  private String postTitle;
  @Column(name = "post_beans")
  private Integer postBeans;
  @Size(max = 2147483647)
  @Column(name = "post_description")
  private String postDescription;
  @Column(name = "post_user_id")
  private String postUserId;
  @Column(name = "post_user_jnick")
  private String postUserJnick;

  public JmbUserPosts() {
  }

  public JmbUserPosts(Integer postId) {
    this.postId = postId;
  }

  public Integer getPostId() {
    return postId;
  }

  public void setPostId(Integer postId) {
    this.postId = postId;
  }

  public String getPostTitle() {
    return postTitle;
  }

  public void setPostTitle(String postTitle) {
    this.postTitle = postTitle;
  }

  public Integer getPostBeans() {
    return postBeans;
  }

  public void setPostBeans(Integer postBeans) {
    this.postBeans = postBeans;
  }

  public String getPostDescription() {
    return postDescription;
  }

  public void setPostDescription(String postDescription) {
    this.postDescription = postDescription;
  }

  public String getPostUserId() {
    return postUserId;
  }

  public void setPostUserId(String postUserId) {
    this.postUserId = postUserId;
  }
  
  public String getPostUserJnick() {
    return postUserJnick;
  }

  public void setPostUserJnick(String postUserJnick) {
    this.postUserJnick = postUserJnick;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (postId != null ? postId.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof JmbUserPosts)) {
      return false;
    }
    JmbUserPosts other = (JmbUserPosts) object;
    if ((this.postId == null && other.postId != null) || (this.postId != null && !this.postId.equals(other.postId))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.app.model.entities.JmbUserPosts[ postId=" + postId + " ]";
  }

  
}
